public class Dolphin extends Animal{

    private int LegNum;
    public Dolphin() {
    }

    public Dolphin(String name) {
        super(name);
    }

    public Dolphin(String name, int legNum) {
        super(name);
        LegNum = legNum;
    }

    public int getLegNum() {
        return LegNum;
    }

    public void setLegNum(int legNum){
        if (legNum == 0) {
            LegNum = legNum;
        }else {
            throw new DolphinException("错误信息！海豚没有腿");
        }
    }

    public void shout() {
        System.out.println("企鹅叫的是海豚音。。。。");
    }
}
